package project.controllers;

import api.entitites.IGarage;
import api.entitites.IMaster;
import api.entitites.IOrder;
import entitiesfactory.EntitiesFactory;


public class CreatorObject {
	
	private static Controller controller=Controller.getInstance();
	private static EntitiesFactory entities_factory=EntitiesFactory.getInstance();
	
	

	public static IGarage addGarage() {
		IGarage garage=(IGarage) entities_factory.getObject(IGarage.class);
		garage.setNumberGarage(controller.getNumberGarage());
		return garage;
	}

	public static IMaster addMaster() {
		IMaster master= (IMaster) entities_factory.getObject(IMaster.class) ;
		master.setNameMaster(controller.getMasterName());
		return master;
	}

	public static IOrder addOrder() {
		IOrder order= (IOrder) entities_factory.getObject(IOrder.class) ;
		
		order.setNumberOrder(controller.getNumberOrder());
		order.setFillingDate(controller.getFillingDate());
		order.setDeadlineDate(controller.getDeadlineDate());
		order.setBeginingDate(controller.getBeginingDate());
		order.setPrice(controller.getPrice());
		
		return order;
	}
}
